home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
The World of Computer Software.iso
/
quasrsql.zip
/
SQL.H
< prev
next >
Wrap
Text File
|
1991-12-05
|
8KB
|
255 lines
/*
* SQL.H - Header file for Quasar SQL Application Programming Interface
*
* LANGUAGE : Microsoft C6.0
* MODEL : N/A
* ENVIRONMENT : Microsoft Windows 3.0
*
* Developed by:
* Philip Roll
* Ming-Li Wang
*
* (C) Copyright 1991
* Stellar Industries
* 3335 S. Falcon Ridge Road
* Diamond Bar CA 91765
* (714) 861-7885
*
*/
/*
*
* Data classes:
*
*/
#define mSqlDataClassAPPROXIMATE 0
#define mSqlDataClassBINARY 1
#define mSqlDataClassCHAR 2
#define mSqlDataClassEXACT 3
#define mSqlDataClassINVALID 4
/*
*
* Data types:
*
*/
#define mSqlDataTypeBINARY 0
#define mSqlDataTypeCHAR 1
#define mSqlDataTypeDECIMAL 2
#define mSqlDataTypeDOUBLE 3
#define mSqlDataTypeFLOAT 4
#define mSqlDataTypeINTEGER 5
#define mSqlDataTypeNUMERIC 6
#define mSqlDataTypeREAL 7
#define mSqlDataTypeSMALLINT 8
#define mSqlDataTypeVARCHAR 9
#define mSqlDataTypeINVALID 10
/*
*
* Error codes:
*
*/
#define mSqlErrorAmbiguousColumn 1
#define mSqlErrorBadEnvironment 2
#define mSqlErrorBinaryNotAllowed 3
#define mSqlErrorCannotActivateFile 4
#define mSqlErrorCannotCloseFile 5
#define mSqlErrorCannotCloseLog 6
#define mSqlErrorCannotCreateDataFile 7
#define mSqlErrorCannotCreateDumpFile 8
#define mSqlErrorCannotCreateFile 9
#define mSqlErrorCannotCreateKeyFile 10
#define mSqlErrorCannotCreateLog 11
#define mSqlErrorCannotDeleteFile 12
#define mSqlErrorCannotDropSystemAdmin 13
#define mSqlErrorCannotDropTable 14
#define mSqlErrorCannotOpenDataFile 15
#define mSqlErrorCannotOpenFile 16
#define mSqlErrorCannotOpenKeyFile 17
#define mSqlErrorCannotOpenLog 18
#define mSqlErrorCannotRemoveTable 19
#define mSqlErrorCannotRevokeByColumn 20
#define mSqlErrorCharNotAllowed 21
#define mSqlErrorCheckpointDetected 22
#define mSqlErrorDataFileCorrupted 23
#define mSqlErrorDatabaseCorrupt 24
#define mSqlErrorDbaNotAvailable 25
#define mSqlErrorDivideByZero 26
#define mSqlErrorDuplicateColumn 27
#define mSqlErrorDuplicateRecord 28
#define mSqlErrorExistingDataFile 29
#define mSqlErrorExistingKeyFile 30
#define mSqlErrorFileReadFailed 31
#define mSqlErrorFileSeekFailed 32
#define mSqlErrorFileWriteFailed 33
#define mSqlErrorGlobalAllocFailed 34
#define mSqlErrorGlobalFreeFailed 35
#define mSqlErrorGlobalLockFailed 36
#define mSqlErrorGlobalUnlockFailed 37
#define mSqlErrorImportParseError 38
#define mSqlErrorIncompatibleTypes 39
#define mSqlErrorIndexExists 40
#define mSqlErrorIndexUndoFailed 41
#define mSqlErrorInitializationFailed 42
#define mSqlErrorInsufficientBuffer 43
#define mSqlErrorInternalError 44
#define mSqlErrorInvalidColumnSpec 45
#define mSqlErrorInvalidColumnType 46
#define mSqlErrorInvalidCursor 47
#define mSqlErrorInvalidData 48
#define mSqlErrorInvalidEscapeChar 49
#define mSqlErrorInvalidPattern 50
#define mSqlErrorInvalidUser 51
#define mSqlErrorKeyFileCorrupted 52
#define mSqlErrorListSizesUnequal 53
#define mSqlErrorLockTableFailure 54
#define mSqlErrorMaximumKeySizeExceeded 55
#define mSqlErrorMultipleSelects 56
#define mSqlErrorNoColumnExists 57
#define mSqlErrorNoIndexExists 58
#define mSqlErrorNoOldRecord 59
#define mSqlErrorNoTableExists 60
#define mSqlErrorNoUserExists 61
#define mSqlErrorNodeSizeTooSmall 62
#define mSqlErrorNotAggregate 63
#define mSqlErrorNotGroupingColumn 64
#define mSqlErrorNotInGroupedTable 65
#define mSqlErrorNotSingleRecord 66
#define mSqlErrorNoUserSlotsAvailable 67
#define mSqlErrorNullInNotNullCol 68
#define mSqlErrorNullNotAllowed 69
#define mSqlErrorParserSyntaxError 70
#define mSqlErrorParserStackOverflow 71
#define mSqlErrorPrecisionConflict 72
#define mSqlErrorResultTableExists 73
#define mSqlErrorScaleOverflow 74
#define mSqlErrorSecurityViolation 75
#define mSqlErrorSetFunctionsNested 76
#define mSqlErrorStarNotAllowed 77
#define mSqlErrorSubqueryNotOneColumn 78
#define mSqlErrorSystemAdminRequired 79
#define mSqlErrorTableConflict 80
#define mSqlErrorTableExists 81
#define mSqlErrorTooManyColumnNames 82
#define mSqlErrorTooManyTablesOpen 83
#define mSqlErrorTrialSizeExceeded 84
#define mSqlErrorVariableHeaderMark 85
#define mSqlErrorVariableHeaderSize 86
#define mSqlErrorVariableHeaderWrong 87
#define mSqlErrorVariableHeaderZero 88
#define mSqlErrorWrongVersion 89
/*
*
* Record structure formats:
*
*/
#define mSqlFlagFormatPadded 0x0000
#define mSqlFlagFormatString 0x0001
#define mSqlFlagFormatStructure 0x0002
/*
*
* Auto commit options:
*
*/
#define mSqlFlagAutoCommitOnLogout 0x0010
/*
*
* Maximum number of characters in a key:
*
*/
#define mSqlMaximumKeySize 192
/*
*
* Maximum number of significant characters in named entity:
*
*/
#define mSqlMaximumNameLength 32
/*
*
* Global types:
*
*/
typedef struct tagSQLCOLUMN {
BOOL bRightJustified;
char szColumnHeading[mSqlMaximumNameLength + 1];
unsigned nColumnSequenceNumber;
unsigned nDataClass;
unsigned nDataType;
unsigned nFieldWidth;
unsigned nPrecision;
unsigned nScale;
} SQLCOLUMN;
typedef SQLCOLUMN *PSQLCOLUMN;
typedef SQLCOLUMN far *LPSQLCOLUMN;
typedef struct tagSQLCONTROL {
char szErrorDetail[65];
char szErrorMessage[257];
unsigned nHiLiteLength;
unsigned nHiLiteOffset;
unsigned nPadding;
unsigned nRecordBufferSize;
unsigned nResultCode;
unsigned long lRecordPosition;
unsigned long lReserved0;
unsigned long lReserved1;
unsigned long lReserved2;
unsigned long lReserved3;
unsigned long lReserved4;
WORD wFlags;
} SQLCONTROL;
typedef SQLCONTROL *PSQLCONTROL;
typedef SQLCONTROL far *LPSQLCONTROL;
typedef struct tagSQLSTATUS {
unsigned long lNumberOfRecordDeletes;
unsigned long lNumberOfRecordInserts;
unsigned long lNumberOfRecordSelects;
unsigned long lNumberOfRecordUpdates;
unsigned long lTimeElapsed;
} SQLSTATUS;
typedef SQLSTATUS *PSQLSTATUS;
typedef SQLSTATUS far *LPSQLSTATUS;
typedef struct tagSQLTABLE {
unsigned nNumberOfColumns;
unsigned nRecordSize;
unsigned long lNumberOfRecords;
} SQLTABLE;
typedef SQLTABLE *PSQLTABLE;
typedef SQLTABLE far *LPSQLTABLE;
/*
*
* Function prototypes:
*
*/
BOOL FAR PASCAL SqlCursorClose(HANDLE, HANDLE, LPSQLCONTROL);
HANDLE FAR PASCAL SqlCursorOpen(HANDLE, LPSQLCONTROL);
BOOL FAR PASCAL SqlDescribeColumn(HANDLE, HANDLE, LPSQLCONTROL, unsigned, LPSQLCOLUMN);
BOOL FAR PASCAL SqlDescribeTable(HANDLE, HANDLE, LPSQLCONTROL, LPSQLTABLE);
BOOL FAR PASCAL SqlExecute(HANDLE, HANDLE, LPSQLCONTROL, LPSTR);
BOOL FAR PASCAL SqlFetchFirst(HANDLE, HANDLE, LPSQLCONTROL, LPSTR);
BOOL FAR PASCAL SqlFetchLast(HANDLE, HANDLE, LPSQLCONTROL, LPSTR);
BOOL FAR PASCAL SqlFetchNext(HANDLE, HANDLE, LPSQLCONTROL, LPSTR);
BOOL FAR PASCAL SqlFetchPositioned(HANDLE, HANDLE, LPSQLCONTROL, unsigned long, LPSTR);
BOOL FAR PASCAL SqlFetchPrevious(HANDLE, HANDLE, LPSQLCONTROL, LPSTR);
BOOL FAR PASCAL SqlGetStatus(HANDLE, HANDLE, LPSQLCONTROL, LPSQLSTATUS);
HANDLE FAR PASCAL SqlLogin(LPSQLCONTROL, LPSTR, LPSTR);
BOOL FAR PASCAL SqlLogout(HANDLE, LPSQLCONTROL);